#include "Scenes.hpp"

int main()
{
    // Create the main window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Window");

    SceneManager manager;

    OpeningScene openingScene;
    MainMenuScene mainMenuScene;
    GameScene gameScene;

    // Add all scenes to scene manager
    manager.Add("Opening", openingScene);
    manager.Add("MainMenu", mainMenuScene);
    manager.Add("Game", gameScene);

    // Start with Opening Scene
    manager.Switch("Game");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        manager.Update(App, Event);

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}
